<% %>
<div class="page_head">
<%if @project%>
<h2><%="People on this project".t%></h2>
<%else%>
<h2><%="People on your compnay/organization".t%></h2>
<%end%>
</div>
<!--add company form-->
<%if @cur_user.have_power?(@project)%>
<%=image_tag "add_icon_big.gif"%> <%=link_to "Add a company".t,"#",:onclick=>"Effect.BlindDown('new_company',{duration:0.2});",:class=>'admin'%>
<%end%>
<div id="new_company" style="display:none;margin:10px;border: 1px #ccc solid;padding:5px;">
 <%form_remote_for :child_company,:url=>{:action=>'create_child_company'} do |t|%>
  <b><%="Company Name".t%></b>: <%=t.text_field :name,:class=>'big_font',:size=>60%>
   <%=t.hidden_field :parent_id,:value=>@cur_user.company.id%>
   <%=hidden_field_tag :project_id,@project%>
   <hr size=1>
   <%=submit_tag"Create this company".t,:onclick=>"Element.show('indicator_new_company')"%> or <%=link_to "Cancel".t,"#",:onclick=>"Effect.BlindUp('new_company',{duration:0.2});",:class=>'admin'%> <%=indicator("new_company")%>
 <%end%>
</div>

<!--add user form-->
<div id="new_user" style="display:<%=(params[:act]=="new"? "on":"none")%>">
<%=render :partial =>'new_user' %>
</div>
<div>
    <span>
      <% if @cur_user.have_power?(@project)%>
      <%=image_tag"icon/add_people.gif"%>
      <%=link_to "Add Person".t,'#',:onclick=>"Effect.BlindDown('new_user',{duration: 0.2});",:class=>'admin'%>
     <%=" - " + @project.name if @project%>
      <%end%>
    </span>
</div>

<!--sub companies-->
<div id='sub_companies'>
  <%=render :partial=>'sub_companies',:locals=>{:project_id=>params[:project_id]}%>
</div>
<div id=main_company>
  <%=render :partial=>'company',:locals=>{:company=>@cur_user.company,:project_id=>params[:project_id]}%>
</div>
